<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <router-link to="/home">home</router-link>
        <router-link to="/about">about</router-link>
        <router-link to="/not-found">not found</router-link>
        <router-view></router-view>
    </div>
</body>
<script src="vue.js"></script>
<script src="vue-router.min.js"></script>
<script>
    const NotFound = { template: '<p>Page not found</p>' }
    const Home = { template: '<p>home page</p>' }
    const About = { template: '<p>about page</p>' }

    const routes = [
        {path: '/', redirect: '/home'},
        {path: '/home', component: Home},
        {path: '/about', component: About},
        {path: '/not-found', component: NotFound},
    ];

    const router = new VueRouter({
        routes: routes
    });
    new Vue({
        el: '#app',
        router: router
    })
</script>
</html>